package com.kx.kxpicture.common;

import com.kx.kxpicture.exception.ErrorCode;
import lombok.Getter;

import java.io.Serializable;

/**
 * 基础响应类
 *
 * @author kuangxin
 * date 2025/8/13
 */
@Getter
public class BaseResponse<T> implements Serializable {
    private int code;
    private T Data;
    private String message;

    public BaseResponse(int code, T data, String message) {
        this.code = code;
        Data = data;
        this.message = message;
    }

    public BaseResponse(int code, T data) {
        this(code,data,"");
    }

    public BaseResponse(ErrorCode errorCode){
        this(errorCode.getCode(),null,errorCode.getMessage());
    }

}
